feat: converting documentation to mkdocs #5276
Draft
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Paired with plotly/plotly.js#7469 (formatting changes to JavaScript that Python docs are derived from).
commands.py
to scripts in newbin
directory and breakinto individual scripts.
./codegen
to./bin/codegen
.plot-schema.json
to./resources
rather than burying it under thecodegen
folder.Makefile
to run commands instead of putting everything incommands.py
.ruff
directly for checking and formatting rather than launching asubprocess from Python as
commands.py
did..gitignore to ignore
docsand
docs_tmp. (Will eventually want to include
docsor overwrite
doc`.)README.md
.CONTRIBUTING.md
to describe relocation of commands and codegeneration to
bin
.CONTRIBUTING.md
documents--local
,--devrepo
and--devbranch
optionsfor updating JavaScript bundle that
commands.py
didn't seem to provide.mkdocs.yml
configuration file formkdocs
.mkdocs
does not support reading configuration frompyproject.toml
, sowe need the extra config file.
material
theme.pages
and write output todocs
.mkdocs-gen-files
plugin.(See discussion of
bin/generate_reference_pages.py
below.)google
(even though much of our documentationisn't formatted that way).
pages
that include files from the rootdirectory (README, code of conduct, contributors' guide, license).
the content is transcluded one directory lower.
plotly/_subplots.py
to escape closing]
with backslashto avoid confusing
mkdocs
Markdown.\\]
because we need\]
in theactual string. We could convert the docstrings to literal strings prefixed
with
r
to avoid the double backslash.[
as\\[
for the same reason.plotly/basedatatypes.py
.plotly/express/_core.py
.pyproject.toml
to installmkdocs
and related packages for dev.pyproject.toml
to installpydoclint
for checking documentation.uv.lock
to match.To do:
scripts/gen_ref_pages.py
intocommands.py
. (Can't do this becausemkdocs.yml
only accepts the name of the script, not parameters.)mkdocs
.pydoclint
..md
files in root directory (taken out because they don't resolve when those files are transcluded frompages/*.md
).\[
formatting glitch in the following files (caused by replacing][
with]\[
to avoid Markdown thinking it's a reference link, but the text is inside back quotes):